package com.tangyuan.common.exception;

import lombok.Getter;

/**
 * @描述: 全局异常
 * @Author: TangYuan
 * @Date: 2024/9/20 下午4:01
 */
public class GlobalException extends RuntimeException {
    
    /**
     * 错误提示
     */
    private String message;
    
    /**
     * 错误明细，内部调试错误
     */
    @Getter
    private String detailMessage;
    
    /**
     * 空构造方法，避免反序列化问题
     */
    public GlobalException() {
    }
    
    public GlobalException(String message) {
        this.message = message;
    }
    
    public GlobalException setDetailMessage(String detailMessage) {
        this.detailMessage = detailMessage;
        return this;
    }
    
    @Override
    public String getMessage() {
        return message;
    }
    
    public GlobalException setMessage(String message) {
        this.message = message;
        return this;
    }
}